package com.gnerv.sylvanas.business.manage.storage;

import com.gnerv.sylvanas.business.manage.model.entity.Dict;
import com.gnerv.sylvanas.business.manage.model.vo.DictDetailsVO;
import com.gnerv.sylvanas.business.manage.model.vo.DictVO;
import com.gnerv.sylvanas.business.manage.repository.mapper.DictMapper;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Gnerv LiGen
 */
@Service
@AllArgsConstructor
public class DictStorageService {

    private final DictMapper dictMapper;

    public int insert(Dict dict) {
        return dictMapper.insert(dict);
    }

    public int deleteByUkId(String ukId) {
        return dictMapper.deleteByUkId(ukId);
    }

    public int updateByUkId(Dict dict) {
        return dictMapper.updateByUkId(dict);
    }

    public DictVO selectVOByUkId(String ukId) {
        return dictMapper.selectVOByUkId(ukId);
    }

    public DictDetailsVO selectDetailsVOByUkId(String ukId) {
        return dictMapper.selectDetailsVOByUkId(ukId);
    }

    public DictDetailsVO selectDetailsVOByCode(String code) {
        return dictMapper.selectDetailsVOByCode(code);
    }

    public List<DictVO> selectListVOByName(String name) {
        return dictMapper.selectListVOByName(name);
    }

    public List<DictDetailsVO> selectListDetailsVOByName(String name) {
        return dictMapper.selectListDetailsVOByName(name);
    }

    public int selectCountByCode(String code) {
        return dictMapper.selectCountByCode(code);
    }

    public int selectCountByDictCodeAndItemValue(String dictCode, String itemValue) {
        return dictMapper.selectCountByDictCodeAndItemValue(dictCode, itemValue);
    }

    public List<DictVO> selectListVOByName(String name, int limitStart, int limitSize) {
        return dictMapper.selectListVOByName(name, limitStart, limitSize);
    }

    public int selectCountByName(String name) {
        return dictMapper.selectCountByName(name);
    }

    public List<DictDetailsVO> selectListDetailsVOByCode(List<String> codeList) {
        return dictMapper.selectListDetailsVOByCode(codeList);
    }
}
